<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <link rel="stylesheet" href="//g.alicdn.com/msui/sm/0.6.2/css/sm.min.css">
  <link rel="stylesheet" href="../css/index.css">
  <link rel="stylesheet" href="../css/myProduct.css">
  <title>我的产品</title>
  <style>
  </style>
</head>

<body class="myProduct page-group">
  <div class="page">
    <!-- //<header class="bar bar-nav" id="golbalHeader"></header> -->

    <!-- 这里是页面内容区 -->
    <div class="content">
      <div class="content-block">
        <div class="card-content">
          <div class="list-block">
            <ul class="productList">

            </ul>
            <p class="moreInfo" onclick="myProduct.loadMore()"></p>
          </div>
        </div>

      </div>
    </div>

  </div>
  <!-- 底部 -->
  <!-- <nav class="bar bar-tab" id="golbalFooter"></nav> -->
  <div id="modal">
    <li>
      <ul>
        <li class="item-content">
          <div class="item-inner">
            <div class="item-title">服务名称</div>
            <div class="item-after name"></div>
          </div>
        </li>

        <li class="item-content">
          <div class="item-inner">
            <div class="item-title">开始时间</div>
            <div class="item-after createTime"></div>
          </div>
        </li>
        <li class="item-content">
          <div class="item-inner">
            <div class="item-title">结束时间</div>
            <div class="item-after updateTime"></div>
          </div>
        </li>
        <li class="item-content">
          <div class="item-inner">
            <div class="item-title">剩余次数</div>
            <div class="item-after times"></div>
          </div>
        </li>
        <li>
          <div class="content-block-title">简介</div>
          <div class="card">
            <div class="card-content">
              <div class="card-content-inner dsc"></div>
            </div>
          </div>
        </li>
      </ul>
    </li>

  </div>
  </div>
  <!-- 标题栏 -->

</body>
<script type='text/javascript' src='//g.alicdn.com/sj/lib/zepto/zepto.min.js' charset='utf-8'></script>
<script type='text/javascript' src='//g.alicdn.com/msui/sm/0.6.2/js/sm.min.js' charset='utf-8'></script>
<script type="text/javascript" src="../js/index.js"></script>
<script type="text/javascript">
  var myProduct = (function ($) {
    $.init()
    var myProduct = new ST({
      golbalHeaderText: '我的产品',
      golbalHeaderFunc: function () {
        window.history.back()
      },
      myProduct: {
        page: 1,
        pageSize: 5
      }
    })
    myProduct.loadMore = function () {
      myProduct.myProduct.page++
        myProduct.http('getmyProduct')
    }
    myProduct.pushAjax({
      getmyProduct: {
        url: '/app/api/private/user/mineProductList',
        data: myProduct.myProduct
      }
    })
    myProduct.pushAjaxSuccess({
      getmyProduct: function (res) {
        if (res.code === '1') {
          res.data.mineProductList.forEach(function (ele) {
            var li = $('#modal>li').clone()
            $(li).find('.name').text(ele.product.name)
            $(li).find('.dsc').text(ele.product.dsc)
            $(li).find('.createTime').text(ele.createTime)
            $(li).find('.updateTime').text(ele.updateTime)
            $(li).find('.times').text(ele.times)
            $(li).appendTo($('ul.productList'))
          })
          if (res.data.mineProductList.length < 5) {
            $('.moreInfo').text('没有更多数据')
          } else {
            $('.moreInfo').text('点击加载更多')
          }
        }
      }
    })

    myProduct.http('getmyProduct')
    myProduct.render()

    return myProduct
  })($)
</script>

</html>